const Mock = require('mockjs');
var Random = Mock.Random;

const data = Mock.mock({
  'items|30': [{
    id: '@id',
    musicName: "@cword(2, 5)",
    'deleteStatus|1': [0, 1],
    singer: "@cname",
    display_time: '@datetime',
   //pageviews: '@integer(300, 5000)'
  }]
})

module.exports = [
  {
    url: '/vue-admin-template/table/list',
    type: 'get',
    response: config => {
      console.log(config.query);
      const { currentPage } = config.query;
      const items = data.items.slice((Number(currentPage)-1)*10, currentPage*10);
      return {
        code: 20000,
        data: {
          total: data.items.length,
          items: items
        }
      }
    }
  }
]
